Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change example code to properly test refcounted objects #949

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

BastiaanOlij
Copy link
Collaborator

@BastiaanOlij BastiaanOlij commented Dec 5, 2022

This changes some of the test logic to properly check Ref<...> scenarios.

We now check:

  • return empty referenced objects
returned empty ref <Object#null>
  • return an instanced object by pointer
ExampleRef 1 created, current instance count: 1
  returned ref -9223372010229333393 , id: 1
  • receiving an instanced object (as well as returning an instance object by reference)
ExampleRef 2 created, current instance count: 2
ExampleRef 3 created, current instance count: 3
  Example ref checks called with value: -9223372010212556172, returning value: -9223372010195778844
  sending ref:  -9223372010212556172 returned ref:  -9223372010195778844

We also output some id's and counts on constructing/destructing ExampleRef so we can see if the output is correct

ExampleRef 3 destroyed, current instance count: 2
ExampleRef 1 destroyed, current instance count: 1
ExampleRef 2 destroyed, current instance count: 0

@BastiaanOlij BastiaanOlij added the enhancement This is an enhancement on the current functionality label Dec 5, 2022
@BastiaanOlij BastiaanOlij self-assigned this Dec 5, 2022
@BastiaanOlij BastiaanOlij force-pushed the fix_tests_refcounting branch from 733632a to f24ee56 Compare December 5, 2022 11:28
@BastiaanOlij BastiaanOlij mentioned this pull request Dec 7, 2022
Copy link
Member

@groud groud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved in PR meeting.

@akien-mga akien-mga merged commit 49a478a into godotengine:master Dec 13, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement on the current functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants